﻿using System.Web.UI;
using System.Web.UI.WebControls;

namespace Shared
{
    public abstract class InputFormField : WebControl
    {
        private static int _counter;

        public override string ID
        {
            get { return base.ID ?? (ID = "LabeledField_" + _counter++); }
            set { base.ID = value; }
        }

        protected override HtmlTextWriterTag TagKey
        {
            get { return HtmlTextWriterTag.P; }
        }

        public override ControlCollection Controls
        {
            get
            {
                EnsureChildControls();
                return base.Controls;
            }
        }
    }
}
